#include<bits/stdc++.h>
using namespace std;bool Mbe;
namespace MAOJUN{

typedef long long ll;

inline void main(){
	int T;scanf("%d",&T);
	for(ll x;T--;){
		scanf("%lld",&x);
		ll l=2,r=2e9,md;
		while(l<r){
			md=l+r>>1;
			x<=(md>>1)*(md-1>>1)?r=md:l=md+1;
		}
		if(~l&1)l+=x&1;
		printf("%lld\n",l);
	}
}
	
}bool Med;int main(){
#ifdef LOCAL
	freopen("2.in","r",stdin);
	freopen("data.out","w",stdout);
#else
	freopen("tree.in","r",stdin);
	freopen("tree.out","w",stdout);
#endif
	MAOJUN::main();
#ifdef LOCAL
	fprintf(stderr,"%lfs\n",clock()/1000.);
	fprintf(stderr,"%lfMB\n",(&Mbe-&Med)/1024./1024);
#endif
	return 0;
}
